package com.dubbo.dubboclient.common;//package springboot.example.springboot.common;
//
//import com.example.demo.boot.Util.JsonMapper;
//import com.example.demo.boot.entity.UserOption;
//import com.example.demo.boot.service.UserOptionService;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Component;
//
//import javax.annotation.PostConstruct;
//import java.util.HashMap;
//import java.util.Map;
//
//@Component
//public class Global {
//    @Autowired
//    private UserOptionService userOptionService;
//
//    private static Global global;
//
//    @PostConstruct
//    public void init() {
//        global = this;
//        global.userOptionService = this.userOptionService;
//    }
//
//    public static String getOption(String optionName, String lableName) {
//        UserOption userOption = global.userOptionService.getByOptionName(optionName);
//        if (userOption != null) {
//            Map<String, String> map = (Map<String, String>) JsonMapper.fromJsonString(userOption.getOptionValue(), HashMap.class);
//            return map.get(lableName);
//        }
//        return "";
//
//
//    }
//}
